package com.shop.front.vo.user;

import com.alibaba.fastjson.annotation.JSONField;
import com.shop.jpa.domain.BaseDomain;
import com.shop.common.enums.user.ExtractStatusEnum;
import com.shop.common.enums.user.ExtractTypeEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@ApiModel("UserExtractVo 提现信息")
@Data
public class UserExtractVo extends BaseDomain implements Serializable {

    @ApiModelProperty(value = "id", hidden = true)
	@Id
    @Column(name = "id")
	@JSONField(serialize=false)
    private Long id;

    /**
	 * 
	 */
    @ApiModelProperty("用户id")
	@Column(name = "user_id")
    @JSONField(serialize=false)
    private Long uid;

    /**
	 * bank = 银行卡 alipay = 支付宝wx=微信
	 */
    @ApiModelProperty("bank = 银行卡 alipay = 支付宝wx=微信")
	@Column(name = "extract_type")
    private String extractType;



    /**
	 * 创建时间
	 */
    @ApiModelProperty("创建时间")
	@Column(name = "fail_time")
    private Date failTime;

    /**
	 * -1 未通过 0 审核中 1 已提现
	 */
    @ApiModelProperty("-1 未通过 0 审核中 1 已提现")
	@Column(name = "status")
    private Integer status;

    /**
	 * 0未知提现类型1余额 2佣金 3 TG
	 */
    @ApiModelProperty("0未知提现类型1余额 2佣金 3 TG")
	@Column(name = "type")
    private Integer type;

    /**
     * 账号
     */
    @Column(name = "account")
    @ApiModelProperty("账号")
    private String account;

    /**
     * 银行预留手机
     */
    @Column(name = "bank_reserve_tel")
    @ApiModelProperty("银行预留手机")
    private String bankReserveTel;


    /**
     * 卡类型
     */
    @Column(name = "card_type")
    @ApiModelProperty("卡类型 alipay bank")
    private String cardType;

    /**
     * 提现金额
     */
    @ApiModelProperty("提现金额")
    @Column(name = "extract_price")
    private BigDecimal extractPrice;


    /**
     * 无效原因
     */
    @ApiModelProperty("无效原因")
    @Column(name = "fail_msg")
    private String failMsg;



    /**
	 * 创建时间
	 */
    @ApiModelProperty("创建时间")
	@Column(name = "create_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty("提现状态")
    @Transient
    private String statusStr;
    public String getStatusStr() {
        if(StringUtils.isNotBlank(this.statusStr)){
            return this.statusStr;
        }
        return ExtractStatusEnum.val(this.status).getName();
    }



}